#ifndef _LED_H_
#define _LED_H_
#include "config.h"
#include "gpio_config.h"
#include "typedef.h"
#include "LED5X7.h"
#include "customer_config.h"

typedef enum {
	LED_FLASH_ON,
	LED_FLASH_FAST,
    #ifdef  LED_FLASH_FAST_FLASH
	LED_FLASH_FAST_FAST,
    #endif
	LED_FLASH_NOR,
	LED_FLASH_STOP,
}LED_FLASH_TYPE;		


#if (LED_TYPE==LED_TUOYUAN_CHARGE_LED)
    #ifdef  UN_USE_CART_BIT
    #define LED_AUX	 	        LED_A
    #define LED_FM		        LED_C
    #define LED_USB		        LED_D
    #define LED_SD		        LED_E
    #define LED_2POINT	        LED_G
    #define LED_BAT_L2		 LED_B
    #define LED_BAT_L1		 LED_F

    #define LED_MP3		0
    #define LED_ALM        0
    #define LED_PLAY	0
    #define LED_PAUSE	0
    #define LED_MHZ	       0

    #define LED_STATUS    LED5X7_var.bShowBuff[4]
    #else
    #define LED_AUX	 	        LED_A
    #define LED_FM		        LED_C
    #define LED_USB		        LED_E
    #define LED_SD		        LED_D
    #define LED_2POINT	        LED_G
    #define LED_BAT_L2		 LED_B
    #define LED_BAT_L1		 LED_F

    #define LED_MP3		0
    #define LED_ALM        0
    #define LED_PLAY	0
    #define LED_PAUSE	0
    #define LED_MHZ	       0

    #define LED_STATUS    LED5X7_var.bShowBuff[4]
    #endif
#elif ( LED_TYPE==LED_7PALY_PAUSE_LED)
    #if defined(K2201_D68_BNX)||defined(USE_24PIN_CHIP_7PIN_LED)
    	#if defined(K4118_S19_SWD)
	    #define LED_PLAY	LED_A
	    #define LED_PAUSE	LED_B
	    #define LED_USB		LED_C
	    #define LED_SD		LED_D
	    #define LED_2POINT	LED_E
	    #define LED_MP3		   LED_G
	    #define LED_MHZ	       LED_F
	    #define LED_FM		LED_H
	    #define LED_ALM        0
	    #define LED_AUX	       0
	    #define LED_AM            0
		#elif defined(K3043_YJH)
        #define LED_PLAY	LED_A
	    #define LED_PAUSE	LED_B
	    #define LED_USB		LED_C
	    #define LED_SD		LED_D
	    #define LED_2POINT	LED_E
	    #define LED_MP3		LED_F
	    #define LED_MHZ	       0
	    #define LED_FM		LED_H
	    #define LED_ALM        0
	    #define LED_AUX	       0
	    #define LED_AM            0
      #else
	    #define LED_PLAY	LED_A
	    #define LED_PAUSE	LED_B
	    #define LED_USB		LED_C
	    #define LED_SD		LED_D
	    #define LED_2POINT	LED_E
	    #define LED_MP3		0
	    #define LED_MHZ	       LED_F
	    #define LED_FM		LED_H
	    #define LED_ALM        0
	    #define LED_AUX	       0
	    #define LED_AM            0
    	#endif
    #elif defined(K1360_LIANSHENG)
    #define LED_PLAY	LED_A
    #define LED_PAUSE	LED_B
    #define LED_USB		LED_C
    #define LED_SD		LED_D
    #define LED_2POINT	LED_E
    #define LED_MP3		LED_H
    #define LED_MHZ	       0
    #define LED_FM		LED_G
    #define LED_ALM        0
    #define LED_AUX	       LED_F
    #define LED_AM            0
    #elif defined(K3043_YJH)
    #define LED_PLAY	LED_A
    #define LED_PAUSE	LED_B
    #define LED_USB		LED_C
    #define LED_SD		LED_D
    #define LED_2POINT	LED_E
    #define LED_MP3		LED_G
    #define LED_MHZ	       0
    #define LED_FM		LED_H
    #define LED_ALM        0
    #define LED_AUX	       0
    #define LED_AM            0 
    #else
    #define LED_PLAY	LED_A
    #define LED_PAUSE	LED_B
    #define LED_USB		LED_C
    #define LED_SD		LED_D
    #define LED_2POINT	LED_E
    #define LED_MP3		LED_H
    #define LED_MHZ	       0
    #define LED_FM		LED_G
    #define LED_ALM        0
    #define LED_AUX	       0
    #define LED_AM            0
    #endif

#define LED_STATUS    LED5X7_var.bShowBuff[4]
#elif (LED_TYPE==LED_7PALY_AUX_CHAGE)
    #define LED_PLAY	       0
    #define LED_PAUSE	       0
    #define LED_USB		LED_C
    #define LED_SD		LED_A
    #define LED_2POINT	LED_E
    #define LED_MP3		0
    #define LED_MHZ	       0
    #define LED_FM		LED_B
    #define LED_ALM            0
    #define LED_AUX	       LED_D

    #define LED_BAT_L2		 LED_G
    #define LED_BAT_L1		 LED_H

   #define LED_STATUS    LED5X7_var.bShowBuff[4]

#elif (LED_TYPE==LED_7TUOYUAN_CHARGE_LED)
    #if defined(LED_SCREEN_UN)
    #define LED_AUX	 	        LED_C
    #define LED_FM		        LED_A
    #define LED_USB		        LED_B
    #define LED_SD		        LED_H
    #define LED_2POINT	        LED_E
    #define LED_BAT_L2		 LED_G
    #define LED_BAT_L1		 LED_D

    #define LED_MP3		0
    #define LED_ALM        0
    #define LED_PLAY	0
    #define LED_PAUSE	0
    #define LED_MHZ	       0
    #define LED_STATUS    LED5X7_var.bShowBuff[4]
    #else
    #define LED_AUX	 	        LED_A
    #define LED_FM		        LED_C
    #define LED_USB		        LED_G
    #define LED_SD		        LED_D
    #define LED_2POINT	        LED_E
    #define LED_BAT_L2		 LED_B
    #define LED_BAT_L1		 LED_H

    #define LED_MP3		0
    #define LED_ALM        0
    #define LED_PLAY	0
    #define LED_PAUSE	0
    #define LED_MHZ	       0
    #define LED_STATUS    LED5X7_var.bShowBuff[4]
    #endif
#elif (LED_TYPE==LED_SW )
#define LED_AUX	       LED_A
#define LED_FM	       LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		LED_G
#define LED_MHZ	       0
#define LED_ALM        0
#define LED_PLAY	0
#define LED_PAUSE	0
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#elif (LED_TYPE==LED_KPL_SMALL_1651_LED)
#define LED_USB		 LED_A
#define LED_FM		 LED_B
#define LED_MP3		 LED_C
#define LED_SD		 LED_D
#define LED_PLAY	 LED_F
#define LED_2POINT	 LED_G
#define LED_PAUSE	 LED_H
#define LED_DOT          LED_E

#define LED_MHZ	       0
#define LED_ALM        0
#define LED_AUX	       0
#if defined(ENABLE_AM)
#define  LED_AM              0
#endif

#define LED_STATUS    LED5X7_var.bShowBuff[4]

#elif (LED_TYPE==LED_CHARGE_LED)

#if defined(K1185n_868_YCL)
#define LED_PLAY	0
#define LED_PAUSE	0
#define LED_USB		LED_C
#define LED_SD		LED_A
#define LED_2POINT	LED_E
#define LED_BAT_L2   LED_F
#define LED_BAT_L1   LED_G
#define LED_MP3		0
#define LED_MHZ	       0
#define LED_FM		LED_B
#define LED_ALM        0
#define LED_AUX	       LED_D
#else
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_BAT_L2   LED_G
#define LED_BAT_L1   LED_F
#define LED_MP3		0
#define LED_MHZ	       0
#define LED_FM		0
#define LED_ALM        0
#define LED_AUX	       0
#endif
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#elif (LED_TYPE==LED_PALY_PAUSE_FM_MP3)
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		LED_G
#define LED_MHZ	       0
#define LED_FM		LED_F
#define LED_ALM        0
#define LED_AUX	       0
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#elif(LED_TYPE==LED_PLAY_PAUSE_AUX)
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		0
#define LED_MHZ	       0
#define LED_FM		LED_G
#define LED_ALM        0
#define LED_AUX	       LED_F
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#elif (LED_TYPE==LED_KUKE_LS_SPECTRUM)
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		0
#define LED_MHZ	       LED_G
#define LED_FM		LED_H
#define LED_ALM        0
#define LED_AUX	       0
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]

#elif (LED_TYPE==LED_SES_SPECTRUM)
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		0
#define LED_MHZ	       LED_G
#define LED_FM		0
#define LED_ALM        0
#define LED_AUX	       LED_F
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]

#elif (LED_TYPE==LED_FANGPING_JIAMEI)
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		0
#define LED_MHZ	       LED_G
#define LED_FM		LED_H
#define LED_ALM        0
#define LED_AUX	       LED_F
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#else
#define LED_PLAY	LED_A
#define LED_PAUSE	LED_B
#define LED_USB		LED_C
#define LED_SD		LED_D
#define LED_2POINT	LED_E
#define LED_MP3		LED_F
#define LED_MHZ	       LED_G
#define LED_FM		LED_H
#define LED_ALM        0
#define LED_AUX	       0
				
#define LED_STATUS    LED5X7_var.bShowBuff[4]
#endif

_near_func  void play_led_flash(void);
_near_func void set_play_flash(LED_FLASH_TYPE led_status);

#if  defined(USER_CHARGR_DETECT_DISPLAY)||defined(USER_CHARGR_DISPLAY)
_near_func  void Disp_ldoin_voltage(void);
_near_func  void Disp_voltage_synchro(void);
#endif

#if  (LED_TYPE==LED_7TUOYUAN_CHARGE_LED||LED_TYPE==LED_7PALY_PAUSE_LED||LED_TYPE==LED_7PALY_AUX_CHAGE)
 _near_func  void LED_SEG_OUT(u8 SEG_Data,u8 COM_Data);
#else
_near_func  void LED_SEG_OUT(u8 SEG_Data);
#endif
_near_func  void LED_COM_OUT(u8 COM_Data);

_near_func  void LED_COM_OFF(void);
void Updata_LED(void);

#endif
